import React, {
	Component
} from "react";
import {
	View,
	Text,
	Image
} from "react-native";
import {
	StackNavigator
} from "react-navigation";
import SearchData from '../models/SearchData';
import styles from "./style";

export default class PropertyView extends Component {
	static navigationOptions = {
		title: "房屋详情"
	}
	constructor(props) {
		super(props);
	}
	render() {
		const {
			houseInfo
		} = this.props.navigation.state.params;
		let stats = houseInfo.bedroom_number + " " + "bed" + " " + houseInfo.property_type;
		if (houseInfo.bathroom_number) {
			stats += "," + houseInfo.bathroom_number + " " + (houseInfo.bathroom_number > 1 ? "bathrooms" : "bathroom");
		}
		return (
			<View>
				<View style={{alignItems: "center"}}>
					<Image style={styles.images2} source={{uri: houseInfo.img_url}} />
				</View>
				<View>
					<View style={{borderBottomWidth: 1, borderBottomColor: "#e1e1e1", padding: 15}}>
						<Text style={styles.detailTitle}>
							{houseInfo.price_formatted}
						</Text>
						<Text style={styles.fontSize16}>
							{houseInfo.title}
						</Text>
					</View>
					<View style={{padding: 15,}}>
						<Text style={[styles.fontSize16, {marginTop: 5, color: "#525252",}]}>
							{stats}
						</Text>
						<Text style={styles.fontSize16}>
							{houseInfo.summary}
						</Text>
					</View>
				</View>
			</View>
		);
	}
}